bbb3af0346b55cc9257cdc46289e89eedecef407,modeshape-jcr/src/main/java/org/modeshape/jcr/cache/document/WritableSessionCache.java,WritableSessionCache,lockNodes,#Collection#,1508
Before Change
assert modeshapeTx != null;
String txId = modeshapeTx.id();
Set<String> lockedKeysForTx = LOCKED_KEYS_BY_TX_ID.computeIfAbsent(txId, id -> new LinkedHashSet<>());
if (keysToLock.removeAll(lockedKeysForTx)) {
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("The keys {0} have been locked previously as part of the transaction {1}; skipping them...",
lockedKeysForTx, txId);
After Change
}
} else {
// there are new nodes that we need to lock...
Set<String> newKeysToLock = new TreeSet<>(changedNodesKeys);
newKeysToLock.removeAll(lockedKeysForTx);
int retryCountOnLockTimeout = 3;
boolean locksAcquired = false;
while (!locksAcquired && retryCountOnLockTimeout > 0) {